// Assuming this is in lib/screens/discover/discover_tab.dart or similar
import 'package:auto_route/auto_route.dart'; // <--- Make sure this is imported
import 'package:flutter/cupertino.dart';
// import 'package:flutter/material.dart'; // Uncomment if you need Material widgets
import 'package:provider_student/config/app_router.dart'; // <--- Import your AppRouter to access generated routes

// import 'recommend_users_screen.dart'; // If recommend_users_screen.dart is not used directly, you can remove this.
// It's likely you meant to import RecommendUserListScreen,
// but even then, you don't need to import the screen here directly
// if you're navigating via auto_route's generated routes.

@RoutePage() // <--- ADD THIS ANNOTATION
class DiscoverTab extends StatefulWidget {
  const DiscoverTab({super.key});

  @override
  State<DiscoverTab> createState() => _DiscoverTabState();
}

class _DiscoverTabState extends State<DiscoverTab> {
  @override
  Widget build(BuildContext context) {
    return CupertinoPageScaffold(
      navigationBar: const CupertinoNavigationBar(middle: Text('发现')),
      child: SafeArea(
        child: ListView(
          children: [
            CupertinoListSection.insetGrouped(
              header: const Text('推荐'),
              children: [
                CupertinoListTile(
                  title: const Text('推荐用户'),
                  trailing: const CupertinoListTileChevron(),
                  onTap: () {
                    context.router.push(const RecommendUserListRoute());
                  },
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
